﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:CodeGenerator="http://sapura.com.my/codegenerator"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                exclude-result-prefixes="msxsl">

    <xsl:output method="text"
                indent="yes" />

    <xsl:template match="Metadata"><xsl:text disable-output-escaping="yes" ><![CDATA[
<wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
                    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
                    xmlns:tns="http://tempuri.org/"
                    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                    xmlns:s="http://www.w3.org/2001/XMLSchema"
                    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
                    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                    targetNamespace="http://tempuri.org/">
    <wsdl:types>
        <s:schema elementFormDefault="qualified"
                    targetNamespace="http://tempuri.org/">
            <s:element name="GetPerson">
                <s:complexType>
                    <s:sequence>
                        <s:element minOccurs="1"
                                    maxOccurs="1"
                                    name="id"
                                    type="s:int"/>
                    </s:sequence>
                </s:complexType>
            </s:element>
            <s:element name="GetPersonResponse">
                <s:complexType>
                    <s:sequence>
                        <s:element minOccurs="0"
                                    maxOccurs="1"
                                    name="GetPersonResult"
                                    type="tns:Person"/>
                    </s:sequence>
                </s:complexType>
            </s:element>
            <s:complexType name="Person">
                <s:sequence>
                    <s:element minOccurs="0"
                                maxOccurs="1"
                                name="FistName"
                                type="s:string"/>
                    <s:element minOccurs="0"
                                maxOccurs="1"
                                name="LastName"
                                type="s:string"/>
                    <s:element minOccurs="1"
                                maxOccurs="1"
                                name="Age"
                                type="s:int"/>
                </s:sequence>
            </s:complexType>
        </s:schema>
    </wsdl:types>
    <wsdl:message name="GetPersonSoapIn">
        <wsdl:part name="parameters"
                    element="tns:GetPerson"/>
    </wsdl:message>
    <wsdl:message name="GetPersonSoapOut">
        <wsdl:part name="parameters"
                    element="tns:GetPersonResponse"/>
    </wsdl:message>
    <wsdl:portType name="PersonServiceSoap">
        <wsdl:operation name="GetPerson">
            <wsdl:input message="tns:GetPersonSoapIn"/>
            <wsdl:output message="tns:GetPersonSoapOut"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="PersonServiceSoap"
                    type="tns:PersonServiceSoap">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="GetPerson">
            <soap:operation soapAction="http://tempuri.org/GetPerson"
                            style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="PersonServiceSoap12"
                    type="tns:PersonServiceSoap">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="GetPerson">
            <soap12:operation soapAction="http://tempuri.org/GetPerson"
                                style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="PersonService">
        <wsdl:port name="PersonServiceSoap"
                    binding="tns:PersonServiceSoap">
            <soap:address location="http://localhost:15034/PersonService.asmx"/>
        </wsdl:port>
        <wsdl:port name="PersonServiceSoap12"
                    binding="tns:PersonServiceSoap12">
            <soap12:address location="http://localhost:15034/PersonService.asmx"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>
]]></xsl:text><xsl:value-of select="CodeGenerator:Save('WebReferences', '_Reference.wsdl')" /></xsl:template>

</xsl:stylesheet>